<header class="header">
    <div class="fix_nav">
        <div class="nav_inner">
            <a class="nav-left back-icon" href="/member/order/index.html">返回</a>
            <div class="tit">付款成功</div>
        </div>
    </div>
</header>
<div class="container mb50">
    <div class="row">
        <ul class="list-group">
            <li class="list-group-item text-primary">订单编号：<?=$order['sn']?></li>
            <?php foreach ($order['products'] as $item):?>
                <li class="list-group-item hproduct clearfix ">
                    <div class="list-group_12">
                        <div class="p-pic">
                            <a href="/product/detail/goods_id/<?=$item['product_id']?>.html">
                                <img src="<?=$item['product_thumb']?>" alt="<?= $item['product_name']?>" class="img-responsive">
                            </a>
                        </div>
                        <div class="p-info">
                            <a href="/product/detail/goods_id/<?=$item['product_id']?>.html">
                                <p class="p-title"><?= $item['product_name']?></p>
                                <p class="p-origin">
                                    <em class="price">¥<?=price_format($item['price'])?></em>
                                </p>
                            </a>
                        </div>
                    </div>
                </li>
            <?php endforeach;?>
            <li class="list-group-item clearfix ">

                <?php $desc = '我已经加盟了高大上的【天天加油】，为中国亿万车主提供加油服务和后市场服务，天天与壕车、VIP接触，我将拥有更进一步的人脉和机会，立即实现壕梦。';?>
                <?php if($order['status'] == OrderModel::STATUS_WATI_ACTIVE):?>
                <?php $desc = '我在天天加油购买一款超值的加油卡，不仅可以超值加油，还可以赚钱！';?>
                <div class="fr mobile_operation" style="line-height: 50px;">
                    <a class="btn btn-default btn-sm" href="/member/order/activate/sn/<?=$order['sn']?>.html">去激活</a>
                </div>
                <?php endif;?>
                <p class="mb0">
                    <span class="pay-point">订单金额:￥<em class="price"><?=price_format($order['amount'])?></em></span>
                </p>
            </li>
            <li class="list-group-item clearfix ">
                <div class="alert alert-warning" role="alert" style="text-align: center">
                    <h5>
                        <?php if($order['status'] == OrderModel::STATUS_WATI_ACTIVE):?>
                        好友们都在盼着这个超值的加油卡，赶紧分享出去，您可以赚取更多销售佣金。
                        <?php else:?>
                        让我们获得更多的机会和佣金，就分享吧
                        <?php endif;?>
                    </h5>
                    <br/>
                    <button id="share_btn" class="btn btn-danger btn-block"> 转发得佣金 </button>
                </div>
            </li>
        </ul>
    </div>
</div>

<?php include APP_PATH.'views/common/share.php'?>
<script type="text/javascript">
    wx.ready(function () {
        var shareData = {
            title: '<?=$item['product_name']?>',
            desc: '<?=$desc?>',
            link: '<?=DOMAIN.'/product/detail/goods_id/'.$item['product_id'].'.html?cpsid='.$cpsid?>',
            imgUrl: '<?=$item['product_thumb']?>',
            fail: function (res) {
                alert(JSON.stringify(res));
            }
        };

        var shareTimeLineData = {
            title: '<?=$desc?>',
            link: '<?=DOMAIN.'/product/detail/goods_id/'.$item['product_id'].'.html?cpsid='.$cpsid?>',
            imgUrl: '<?=$item['product_thumb']?>',
            fail: function (res) {
                alert(JSON.stringify(res));
            }
        };

        wx.onMenuShareAppMessage(shareData);
        wx.onMenuShareTimeline(shareTimeLineData);
        wx.onMenuShareQQ(shareData);
        wx.onMenuShareWeibo(shareData);
    });
</script>